package com.chixing.service.impl;

import com.chixing.mapper.ProductMapper;
import com.chixing.pojo.Product;
import com.chixing.service.GetListCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GetListCartServiceImpl implements GetListCartService {
    @Autowired
    private ProductMapper productMapper;
    @Override
    public List<Product> getAll() {
        return productMapper.selectByExample(null);
    }

    @Override
    public Product getById(Integer productId) {
     return   productMapper.selectByPrimaryKey(productId);

    }
}
